-
-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CancelAsync Cause Deadlock #1345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add a test for forceKill = true as well?
test/Renci.SshNet.IntegrationTests/OldIntegrationTests/SshCommandTest.cs
Outdated
Show resolved
Hide resolved
test/Renci.SshNet.IntegrationTests/OldIntegrationTests/SshCommandTest.cs
Outdated
Show resolved
Hide resolved
@@ -356,13 +357,12 @@ public string EndExecute(IAsyncResult asyncResult) | |||
/// <summary> | |||
/// Cancels command execution in asynchronous scenarios. | |||
/// </summary> | |||
public void CancelAsync() | |||
/// <param name="forceKill">if true send SIGKILL instead of SIGTERM.</param> | |||
public void CancelAsync(bool forceKill = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we drop the Async
suffix here (and obsolete CancelAsync
) as it is not an async method. @WojciechNagorski?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I don't have much time for this project at the moment. Only PRs that have @Rob-Hague's approval are verified and merged by me.
Fix CancelAsync causing deadlocking:
it now signal WaitHandle of Cancelled event after sending SIGTERM/SIGKILL signal to try to abort the request.
close #1147 and close #1023